/*
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 *
 *     __  ___   ______        ___       __          ___
 *    |  |/  /  /  __  \      /   \     |  |        /   \
 *    |  '  /  |  |  |  |    /  ^  \    |  |       /  ^  \
 *    |    <   |  |  |  |   /  /_\  \   |  |      /  /_\  \
 *    |  .  \  |  `--'  |  /  _____  \  |  `----./  _____  \
 *    |__|\__\  \______/  /__/     \__\ |_______/__/     \__\
 *
 *
 *
 * Created by Tommy on 15/3/6.
 * Copyright (c) 2015 Koala Team. All rights reserved.
 */

#import "KLPushModel.h"#import "OCMArg.h"


@implementation KLPushAlertModel

+(JSONKeyMapper*)keyMapper{
    return [[JSONKeyMapper alloc] initWithDictionary:@{@"title-loc-key":@"titleLocKey",
            @"title-loc-args":@"titleLocArgs",
            @"action-loc-key":@"actionLocKey",
            @"loc-key":@"locKey",
            @"loc-args":@"locArgs",
            @"launch-image":@"launchImage"
    }];
}



@end



@implementation KLPUshAPNModel

+(JSONKeyMapper*)keyMapper{
    return [[JSONKeyMapper alloc] initWithDictionary:@{@"content-available":@"contentAvailable"}];
}

- (void)setAlert:(id)alert {

    [self willChangeValueForKey:@"alert"];

    if([alert isKindOfClass:[NSDictionary class]]){
        _alert = [[KLPushAlertModel alloc] initWithDictionary:alert error:nil];
    }else{
        _alert = [[KLPushAlertModel alloc] init];
        _alert.title = alert;
    }
    [self didChangeValueForKey:@"alert"];
}
@end

@implementation KLPushModel {

}
@end